
class MyThreadFromRunnable implements Runnable{

    @Override
    public void run() {

        String currentThreadName = Thread.currentThread().getName();
        for (int i = 0; i < 5; i++) {
            System.out.println("当前线程["+currentThreadName+"]的run()方法正在执行");
        }
    }
}

public class Ds {
    public static void main(String[] args) {

        MyThreadFromRunnable mythread = new MyThreadFromRunnable();

        Thread thread1 = new Thread(mythread, "Thread01");
        thread1.start();

        Thread thread2 = new Thread(mythread, "Thread02");
        thread2.start();
    }
}